Graph View is placed in the public domain for non-commercial use by not-for-profit educational institutions in the United States. All other rights reserved.
*/
/*
Add the following files if you want to use a GraphView object in your application:
CommonDefs.h
GraphView.h
libGraphView.a
GraphViewControls.nib
cross.tiff
Unzoom.tiff
*/
#import <appkit/View.h>
#import "CommonDefs.h"
typedef struct
{
float redVal;
float greVal;
float bluVal;
}colorType;
typedef struct
{
NXDPoint coords;
int penStyle;
colorType penColor;
double size;
}storedDataType;
typedef struct
{
double edge;
double height;
double size;
colorType penColor;
}sortedHistogramDataType;
typedef struct
{
NXDPoint data;
double binEdge;
double size;
colorType penColor;
}rawHistogramDataType;
typedef struct
{ double xmin, xmax, ymin, ymax;
}graphExtremeties;
#define CENTRE 0
#define TOP 2
#define BOTTOM 1
#define LEFT 1
#define RIGHT 2
#define ORIGIN 3
#define LIFT 0
#define SLINE 1
#define DLINE 2
#define CIRCLE 3
#define SQUARE 4
#define MINIMALASCIICOPY 1
#define FULLASCIICOPY 2
#define CORRECTMARGINS 0
#define LABELIFMARGIN 1
#define DPSDATALIMIT 2048
#define DPSOPLIMIT 1024
#define LINEAR 0
#define LOG 1
#define POLAR 2
#define HORIZONTAL 0
#define VERTICAL 1
@interface GraphView:View
{
id crossCursor;
id unZoomCursor;
id dataPoints;
id rawHistPoints;
id sortedHistPoints;
id xMinField;
id xMaxField;
id yMinField;
id yMaxField;
id xMajTickWidthField;
id yMajTickWidthField;
id xTickStartField;
id yTickStartField;
id cBinEdgeField;
id binWidthField;
id binOffsetField;
id maxStrokeRatioField;
id thePasteBoard;
id xAutoSW;
id yAutoSW;
id nibIncreaseButton;
id nibDecreaseButton;
id strokeIncreaseButton;
id strokeDecreaseButton;
id pointRadiusField;
id lineThicknessField;
id strokeWidthField;
id readOut;
id zoomList;
id delegate;
id snapShot;
id xPlotModeSelector;
id yPlotModeSelector;
id oldEdgeField;
id newEdgeField;
id controlPanel; //Do not archive!!
id histogramInspector; //Do not archive!!
// Some color definitions
colorType gridColor;
colorType grBackColor;
colorType ticksColor;
colorType scaleColor;
colorType axesColor;
colorType titleColor;
colorType xyTitleColor;
colorType axesOrderColor;
colorType marginColor;
colorType outlineColor;
// Pen Attributes
colorType cPenColor;
int cPenStyle;
// Miscelleneous
BOOL graphViewInitialized;
BOOL xAutoscale;
BOOL yAutoscale;
BOOL canScroll;
BOOL gridVisible;
BOOL majTicksVisible;
BOOL minTicksVisible;
BOOL xAxisVisible;
BOOL yAxisVisible;
BOOL labelsVisible;
BOOL drawingEnabled;
BOOL psOpsAllowed;
BOOL userWarnedForPSOps;
BOOL drawInColor;
BOOL snapShotIsCurrent;
BOOL snapShotOK;
BOOL controlPanelOpen;
BOOL axisSynchronized;
int histogramOrientation;
int xAxisLoc;
int yAxisLoc;
int numMinorTicks;
int maxTickLimit;
int normTickLimit;
int asciiCopyType;
int labelDisplayOption;
int xPlotMode;
int yPlotMode;
double cBinEdge; // Required for histograms
double binWidth; // Required for histograms
double binOffset; // Required for histograms
double currentNibInc;
double autoscaleInc;
double xOrder; //Order of extremeties
double yOrder;
double xAxPos, yAxPos, xOLabelPos, yOLabelPos;
double xTickStart, yTickStart;
double xMajTickWidth;
double yMajTickWidth;
double lineThickness;
double histStrokeWidth;
double maxStrokeRatio; //Fraction of bin width
double pointRadius;
double xMin;
double xMax;
double yMin;
double yMax;
double yMargins;
double xMargins;
double defLineWidth;
double gutterWidth;
double xMarginWidth;
double yMarginWidth;
double titleXPos, titleYPos;
char *graphTitlePtr;
char *xTitlePtr;
char *yTitlePtr;
// Line Dashing Patterns
float pat1[0];
float pat2[1];
float bbox[4];
}
// The following procedures initialize the object and control its general behavior;
- initFrame:(const NXRect *)frameRect;
- read:(NXTypedStream*)stream;
- write:(NXTypedStream*)stream;
- readCoordData:(NXTypedStream *)stream;
- readHistData:(NXTypedStream *)stream;
- writeCoordData:(NXTypedStream *)stream;
- writeHistData:(NXTypedStream *)stream;
- awake;
// These are methods that involve the actual data.